<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
<html><head><title>QMatrix4x4 Class Reference</title><style>h3.fn,span.fn { margin-left: 1cm; text-indent: -1cm }
a:link { color: #004faf; text-decoration: none }
a:visited { color: #672967; text-decoration: none }
td.postheader { font-family: sans-serif }
tr.address { font-family: sans-serif }
body { background: #ffffff; color: black; }
</style></head><body><table border="0" cellpadding="0" cellspacing="0" width="100%"><tr /><td align="left" valign="top" width="32"><img align="left" border="0" height="32" src="images/rb-logo.png" width="32" /></td><td width="1">&#160;&#160;</td><td class="postheader" valign="center"><a href="index.html"><font color="#004faf">Home</font></a>&#160;&#183; <a href="classes.html"><font color="#004faf">All Classes</font></a>&#160;&#183; <a href="modules.html"><font color="#004faf">Modules</font></a></td></table><h1 align="center">QMatrix4x4 Class Reference<br /><sup><sup>[<a href="qtgui.html">QtGui</a> module]</sup></sup></h1><p>The QMatrix4x4 class represents a 4x4 transformation matrix in
3D space. <a href="#details">More...</a></p>

<h3>Methods</h3><ul><li><div class="fn" /><b><a href="qmatrix4x4.html#QMatrix4x4">__init__</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qmatrix4x4.html#QMatrix4x4-2">__init__</a></b> (<i>self</i>, sequence-of-float&#160;<i>values</i>)</li><li><div class="fn" /><b><a href="qmatrix4x4.html#QMatrix4x4-3">__init__</a></b> (<i>self</i>, float&#160;<i>m11</i>, float&#160;<i>m12</i>, float&#160;<i>m13</i>, float&#160;<i>m14</i>, float&#160;<i>m21</i>, float&#160;<i>m22</i>, float&#160;<i>m23</i>, float&#160;<i>m24</i>, float&#160;<i>m31</i>, float&#160;<i>m32</i>, float&#160;<i>m33</i>, float&#160;<i>m34</i>, float&#160;<i>m41</i>, float&#160;<i>m42</i>, float&#160;<i>m43</i>, float&#160;<i>m44</i>)</li><li><div class="fn" /><b><a href="qmatrix4x4.html#QMatrix4x4-4">__init__</a></b> (<i>self</i>, QTransform&#160;<i>transform</i>)</li><li><div class="fn" /><b><a href="qmatrix4x4.html#QMatrix4x4-5">__init__</a></b> (<i>self</i>, QMatrix&#160;<i>matrix</i>)</li><li><div class="fn" /><b><a href="qmatrix4x4.html#QMatrix4x4-6">__init__</a></b> (<i>self</i>, QMatrix4x4)</li><li><div class="fn" />QVector4D <b><a href="qmatrix4x4.html#column">column</a></b> (<i>self</i>, int&#160;<i>index</i>)</li><li><div class="fn" />list-of-float <b><a href="qmatrix4x4.html#copyDataTo">copyDataTo</a></b> (<i>self</i>)</li><li><div class="fn" />list-of-float <b><a href="qmatrix4x4.html#data">data</a></b> (<i>self</i>)</li><li><div class="fn" />float <b><a href="qmatrix4x4.html#determinant">determinant</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qmatrix4x4.html#fill">fill</a></b> (<i>self</i>, float&#160;<i>value</i>)</li><li><div class="fn" /><b><a href="qmatrix4x4.html#flipCoordinates">flipCoordinates</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qmatrix4x4.html#frustum">frustum</a></b> (<i>self</i>, float&#160;<i>left</i>, float&#160;<i>right</i>, float&#160;<i>bottom</i>, float&#160;<i>top</i>, float&#160;<i>nearPlane</i>, float&#160;<i>farPlane</i>)</li><li><div class="fn" />(QMatrix4x4, bool&#160;<i>invertible</i>) <b><a href="qmatrix4x4.html#inverted">inverted</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qmatrix4x4.html#isIdentity">isIdentity</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qmatrix4x4.html#lookAt">lookAt</a></b> (<i>self</i>, QVector3D&#160;<i>eye</i>, QVector3D&#160;<i>center</i>, QVector3D&#160;<i>up</i>)</li><li><div class="fn" />QPoint <b><a href="qmatrix4x4.html#map">map</a></b> (<i>self</i>, QPoint&#160;<i>point</i>)</li><li><div class="fn" />QPointF <b><a href="qmatrix4x4.html#map-2">map</a></b> (<i>self</i>, QPointF&#160;<i>point</i>)</li><li><div class="fn" />QVector3D <b><a href="qmatrix4x4.html#map-3">map</a></b> (<i>self</i>, QVector3D&#160;<i>point</i>)</li><li><div class="fn" />QVector4D <b><a href="qmatrix4x4.html#map-4">map</a></b> (<i>self</i>, QVector4D&#160;<i>point</i>)</li><li><div class="fn" />QRect <b><a href="qmatrix4x4.html#mapRect">mapRect</a></b> (<i>self</i>, QRect&#160;<i>rect</i>)</li><li><div class="fn" />QRectF <b><a href="qmatrix4x4.html#mapRect-2">mapRect</a></b> (<i>self</i>, QRectF&#160;<i>rect</i>)</li><li><div class="fn" />QVector3D <b><a href="qmatrix4x4.html#mapVector">mapVector</a></b> (<i>self</i>, QVector3D&#160;<i>vector</i>)</li><li><div class="fn" />QMatrix3x3 <b><a href="qmatrix4x4.html#normalMatrix">normalMatrix</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qmatrix4x4.html#optimize">optimize</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qmatrix4x4.html#ortho">ortho</a></b> (<i>self</i>, QRect&#160;<i>rect</i>)</li><li><div class="fn" /><b><a href="qmatrix4x4.html#ortho-2">ortho</a></b> (<i>self</i>, QRectF&#160;<i>rect</i>)</li><li><div class="fn" /><b><a href="qmatrix4x4.html#ortho-3">ortho</a></b> (<i>self</i>, float&#160;<i>left</i>, float&#160;<i>right</i>, float&#160;<i>bottom</i>, float&#160;<i>top</i>, float&#160;<i>nearPlane</i>, float&#160;<i>farPlane</i>)</li><li><div class="fn" /><b><a href="qmatrix4x4.html#perspective">perspective</a></b> (<i>self</i>, float&#160;<i>angle</i>, float&#160;<i>aspect</i>, float&#160;<i>nearPlane</i>, float&#160;<i>farPlane</i>)</li><li><div class="fn" /><b><a href="qmatrix4x4.html#rotate">rotate</a></b> (<i>self</i>, float&#160;<i>angle</i>, QVector3D&#160;<i>vector</i>)</li><li><div class="fn" /><b><a href="qmatrix4x4.html#rotate-2">rotate</a></b> (<i>self</i>, float&#160;<i>angle</i>, float&#160;<i>x</i>, float&#160;<i>y</i>, float&#160;<i>z</i>&#160;=&#160;0)</li><li><div class="fn" /><b><a href="qmatrix4x4.html#rotate-3">rotate</a></b> (<i>self</i>, QQuaternion&#160;<i>quaternion</i>)</li><li><div class="fn" />QVector4D <b><a href="qmatrix4x4.html#row">row</a></b> (<i>self</i>, int&#160;<i>index</i>)</li><li><div class="fn" /><b><a href="qmatrix4x4.html#scale">scale</a></b> (<i>self</i>, QVector3D&#160;<i>vector</i>)</li><li><div class="fn" /><b><a href="qmatrix4x4.html#scale-2">scale</a></b> (<i>self</i>, float&#160;<i>x</i>, float&#160;<i>y</i>)</li><li><div class="fn" /><b><a href="qmatrix4x4.html#scale-3">scale</a></b> (<i>self</i>, float&#160;<i>x</i>, float&#160;<i>y</i>, float&#160;<i>z</i>)</li><li><div class="fn" /><b><a href="qmatrix4x4.html#scale-4">scale</a></b> (<i>self</i>, float&#160;<i>factor</i>)</li><li><div class="fn" /><b><a href="qmatrix4x4.html#setColumn">setColumn</a></b> (<i>self</i>, int&#160;<i>index</i>, QVector4D&#160;<i>value</i>)</li><li><div class="fn" /><b><a href="qmatrix4x4.html#setRow">setRow</a></b> (<i>self</i>, int&#160;<i>index</i>, QVector4D&#160;<i>value</i>)</li><li><div class="fn" /><b><a href="qmatrix4x4.html#setToIdentity">setToIdentity</a></b> (<i>self</i>)</li><li><div class="fn" />QMatrix <b><a href="qmatrix4x4.html#toAffine">toAffine</a></b> (<i>self</i>)</li><li><div class="fn" />QTransform <b><a href="qmatrix4x4.html#toTransform">toTransform</a></b> (<i>self</i>)</li><li><div class="fn" />QTransform <b><a href="qmatrix4x4.html#toTransform-2">toTransform</a></b> (<i>self</i>, float&#160;<i>distanceToPlane</i>)</li><li><div class="fn" /><b><a href="qmatrix4x4.html#translate">translate</a></b> (<i>self</i>, QVector3D&#160;<i>vector</i>)</li><li><div class="fn" /><b><a href="qmatrix4x4.html#translate-2">translate</a></b> (<i>self</i>, float&#160;<i>x</i>, float&#160;<i>y</i>)</li><li><div class="fn" /><b><a href="qmatrix4x4.html#translate-3">translate</a></b> (<i>self</i>, float&#160;<i>x</i>, float&#160;<i>y</i>, float&#160;<i>z</i>)</li><li><div class="fn" />QMatrix4x4 <b><a href="qmatrix4x4.html#transposed">transposed</a></b> (<i>self</i>)</li></ul><h3>Special Methods</h3><ul><li><div class="fn" />QMatrix4x4 <b><a href="qmatrix4x4.html#__add__">__add__</a></b> (<i>self</i>, QMatrix4x4&#160;<i>m2</i>)</li><li><div class="fn" />QMatrix4x4 <b><a href="qmatrix4x4.html#__div__">__div__</a></b> (<i>self</i>, float&#160;<i>divisor</i>)</li><li><div class="fn" />bool <b><a href="qmatrix4x4.html#__eq__">__eq__</a></b> (<i>self</i>, QMatrix4x4&#160;<i>other</i>)</li><li><div class="fn" />object <b><a href="qmatrix4x4.html#__getitem__">__getitem__</a></b> (<i>self</i>, object)</li><li><div class="fn" />QMatrix4x4 <b><a href="qmatrix4x4.html#__iadd__">__iadd__</a></b> (<i>self</i>, QMatrix4x4&#160;<i>other</i>)</li><li><div class="fn" />QMatrix4x4 <b><a href="qmatrix4x4.html#__idiv__">__idiv__</a></b> (<i>self</i>, float&#160;<i>divisor</i>)</li><li><div class="fn" />QMatrix4x4 <b><a href="qmatrix4x4.html#__imul__">__imul__</a></b> (<i>self</i>, QMatrix4x4&#160;<i>other</i>)</li><li><div class="fn" />QMatrix4x4 <b><a href="qmatrix4x4.html#__imul__-2">__imul__</a></b> (<i>self</i>, float&#160;<i>factor</i>)</li><li><div class="fn" />QMatrix4x4 <b><a href="qmatrix4x4.html#__isub__">__isub__</a></b> (<i>self</i>, QMatrix4x4&#160;<i>other</i>)</li><li><div class="fn" />QMatrix4x4 <b><a href="qmatrix4x4.html#__mul__">__mul__</a></b> (<i>self</i>, QMatrix4x4&#160;<i>m2</i>)</li><li><div class="fn" />QVector3D <b><a href="qmatrix4x4.html#__mul__-2">__mul__</a></b> (<i>self</i>, QVector3D&#160;<i>vector</i>)</li><li><div class="fn" />QVector4D <b><a href="qmatrix4x4.html#__mul__-3">__mul__</a></b> (<i>self</i>, QVector4D&#160;<i>vector</i>)</li><li><div class="fn" />QPoint <b><a href="qmatrix4x4.html#__mul__-4">__mul__</a></b> (<i>self</i>, QPoint&#160;<i>point</i>)</li><li><div class="fn" />QPointF <b><a href="qmatrix4x4.html#__mul__-5">__mul__</a></b> (<i>self</i>, QPointF&#160;<i>point</i>)</li><li><div class="fn" />QMatrix4x4 <b><a href="qmatrix4x4.html#__mul__-6">__mul__</a></b> (<i>self</i>, QMatrix4x4&#160;<i>matrix</i>)</li><li><div class="fn" />QMatrix4x4 <b><a href="qmatrix4x4.html#__mul__-7">__mul__</a></b> (<i>self</i>, float&#160;<i>factor</i>)</li><li><div class="fn" />bool <b><a href="qmatrix4x4.html#__ne__">__ne__</a></b> (<i>self</i>, QMatrix4x4&#160;<i>other</i>)</li><li><div class="fn" />QMatrix4x4 <b><a href="qmatrix4x4.html#__neg__">__neg__</a></b> (<i>self</i>)</li><li><div class="fn" />str <b><a href="qmatrix4x4.html#__repr__">__repr__</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qmatrix4x4.html#__setitem__">__setitem__</a></b> (<i>self</i>, object, float)</li><li><div class="fn" />QMatrix4x4 <b><a href="qmatrix4x4.html#__sub__">__sub__</a></b> (<i>self</i>, QMatrix4x4&#160;<i>m2</i>)</li></ul><a name="details" /><hr /><h2>Detailed Description</h2><p>This class can be pickled.</p><p>The QMatrix4x4 class represents a 4x4 transformation matrix in
3D space.</p>
<hr /><h2>Method Documentation</h2><h3 class="fn"><a name="QMatrix4x4" />QMatrix4x4.__init__ (<i>self</i>)</h3><p>Constructs an identity matrix.</p>


<h3 class="fn"><a name="QMatrix4x4-2" />QMatrix4x4.__init__ (<i>self</i>, sequence-of-float&#160;<i>values</i>)</h3><p>Constructs a matrix from the given 16 floating-point
<i>values</i>. The contents of the array <i>values</i> is assumed
to be in row-major order.</p>
<p>If the matrix has a special type (identity, translate, scale,
etc), the programmer should follow this constructor with a call to
<a href="qmatrix4x4.html#optimize">optimize</a>() if they wish
<a href="qmatrix4x4.html">QMatrix4x4</a> to optimize further calls
to <a href="qmatrix4x4.html#translate">translate</a>(), <a href="qmatrix4x4.html#scale">scale</a>(), etc.</p>
<p><b>See also</b> <a href="qmatrix4x4.html#copyDataTo">copyDataTo</a>() and <a href="qmatrix4x4.html#optimize">optimize</a>().</p>


<h3 class="fn"><a name="QMatrix4x4-3" />QMatrix4x4.__init__ (<i>self</i>, float&#160;<i>m11</i>, float&#160;<i>m12</i>, float&#160;<i>m13</i>, float&#160;<i>m14</i>, float&#160;<i>m21</i>, float&#160;<i>m22</i>, float&#160;<i>m23</i>, float&#160;<i>m24</i>, float&#160;<i>m31</i>, float&#160;<i>m32</i>, float&#160;<i>m33</i>, float&#160;<i>m34</i>, float&#160;<i>m41</i>, float&#160;<i>m42</i>, float&#160;<i>m43</i>, float&#160;<i>m44</i>)</h3><p>Constructs a matrix from the 16 elements <i>m11</i>, <i>m12</i>,
<i>m13</i>, <i>m14</i>, <i>m21</i>, <i>m22</i>, <i>m23</i>,
<i>m24</i>, <i>m31</i>, <i>m32</i>, <i>m33</i>, <i>m34</i>,
<i>m41</i>, <i>m42</i>, <i>m43</i>, and <i>m44</i>. The elements
are specified in row-major order.</p>
<p>If the matrix has a special type (identity, translate, scale,
etc), the programmer should follow this constructor with a call to
<a href="qmatrix4x4.html#optimize">optimize</a>() if they wish
<a href="qmatrix4x4.html">QMatrix4x4</a> to optimize further calls
to <a href="qmatrix4x4.html#translate">translate</a>(), <a href="qmatrix4x4.html#scale">scale</a>(), etc.</p>
<p><b>See also</b> <a href="qmatrix4x4.html#optimize">optimize</a>().</p>


<h3 class="fn"><a name="QMatrix4x4-4" />QMatrix4x4.__init__ (<i>self</i>, <a href="qtransform.html">QTransform</a>&#160;<i>transform</i>)</h3><p>Constructs a 4x4 matrix from the left-most 4 columns and
top-most 4 rows of <i>matrix</i>. If <i>matrix</i> has less than 4
columns or rows, the remaining elements are filled with elements
from the identity matrix.</p>
<p><b>See also</b> <a href="qmatrix4x4.html#toGenericMatrix">toGenericMatrix</a>().</p>


<h3 class="fn"><a name="QMatrix4x4-5" />QMatrix4x4.__init__ (<i>self</i>, <a href="qmatrix.html">QMatrix</a>&#160;<i>matrix</i>)</h3><h3 class="fn"><a name="QMatrix4x4-6" />QMatrix4x4.__init__ (<i>self</i>, <a href="qmatrix4x4.html">QMatrix4x4</a>)</h3><p>Constructs a 4x4 matrix from the conventional Qt 2D
transformation matrix <i>transform</i>.</p>
<p>If <i>transform</i> has a special type (identity, translate,
scale, etc), the programmer should follow this constructor with a
call to <a href="qmatrix4x4.html#optimize">optimize</a>() if they
wish <a href="qmatrix4x4.html">QMatrix4x4</a> to optimize further
calls to <a href="qmatrix4x4.html#translate">translate</a>(),
<a href="qmatrix4x4.html#scale">scale</a>(), etc.</p>
<p><b>See also</b> <a href="qmatrix4x4.html#toTransform">toTransform</a>() and <a href="qmatrix4x4.html#optimize">optimize</a>().</p>


<h3 class="fn"><a name="column" /><a href="qvector4d.html">QVector4D</a> QMatrix4x4.column (<i>self</i>, int&#160;<i>index</i>)</h3><p>Returns the elements of column <i>index</i> as a 4D vector.</p>
<p><b>See also</b> <a href="qmatrix4x4.html#setColumn">setColumn</a>() and <a href="qmatrix4x4.html#row">row</a>().</p>


<h3 class="fn"><a name="copyDataTo" />list-of-float QMatrix4x4.copyDataTo (<i>self</i>)</h3><p>Retrieves the 16 items in this matrix and copies them to
<i>values</i> in row-major order.</p>


<h3 class="fn"><a name="data" />list-of-float QMatrix4x4.data (<i>self</i>)</h3><p>Returns a pointer to the raw data of this matrix.</p>
<p><b>See also</b> <a href="qmatrix4x4.html#constData">constData</a>() and <a href="qmatrix4x4.html#optimize">optimize</a>().</p>


<h3 class="fn"><a name="determinant" />float QMatrix4x4.determinant (<i>self</i>)</h3><p>Returns the determinant of this matrix.</p>


<h3 class="fn"><a name="fill" />QMatrix4x4.fill (<i>self</i>, float&#160;<i>value</i>)</h3><p>Fills all elements of this matrx with <i>value</i>.</p>


<h3 class="fn"><a name="flipCoordinates" />QMatrix4x4.flipCoordinates (<i>self</i>)</h3><p>Flips between right-handed and left-handed coordinate systems by
multiplying the y and z co-ordinates by -1. This is normally used
to create a left-handed orthographic view without scaling the
viewport as <a href="qmatrix4x4.html#ortho">ortho</a>() does.</p>
<p><b>See also</b> <a href="qmatrix4x4.html#ortho">ortho</a>().</p>


<h3 class="fn"><a name="frustum" />QMatrix4x4.frustum (<i>self</i>, float&#160;<i>left</i>, float&#160;<i>right</i>, float&#160;<i>bottom</i>, float&#160;<i>top</i>, float&#160;<i>nearPlane</i>, float&#160;<i>farPlane</i>)</h3><p>Multiplies this matrix by another that applies a perspective
frustum projection for a window with lower-left corner
(<i>left</i>, <i>bottom</i>), upper-right corner (<i>right</i>,
<i>top</i>), and the specified <i>nearPlane</i> and <i>farPlane</i>
clipping planes.</p>
<p><b>See also</b> <a href="qmatrix4x4.html#ortho">ortho</a>() and
<a href="qmatrix4x4.html#perspective">perspective</a>().</p>


<h3 class="fn"><a name="inverted" />(<a href="qmatrix4x4.html">QMatrix4x4</a>, bool&#160;<i>invertible</i>) QMatrix4x4.inverted (<i>self</i>)</h3><p>Returns the inverse of this matrix. Returns the identity if this
matrix cannot be inverted; i.e. <a href="qmatrix4x4.html#determinant">determinant</a>() is zero. If
<i>invertible</i> is not null, then true will be written to that
location if the matrix can be inverted; false otherwise.</p>
<p>If the matrix is recognized as the identity or an orthonormal
matrix, then this function will quickly invert the matrix using
optimized routines.</p>
<p><b>See also</b> <a href="qmatrix4x4.html#determinant">determinant</a>() and <a href="qmatrix4x4.html#normalMatrix">normalMatrix</a>().</p>


<h3 class="fn"><a name="isIdentity" />bool QMatrix4x4.isIdentity (<i>self</i>)</h3><p>Returns true if this matrix is the identity; false
otherwise.</p>
<p><b>See also</b> <a href="qmatrix4x4.html#setToIdentity">setToIdentity</a>().</p>


<h3 class="fn"><a name="lookAt" />QMatrix4x4.lookAt (<i>self</i>, <a href="qvector3d.html">QVector3D</a>&#160;<i>eye</i>, <a href="qvector3d.html">QVector3D</a>&#160;<i>center</i>, <a href="qvector3d.html">QVector3D</a>&#160;<i>up</i>)</h3><p>Multiplies this matrix by another that applies an <i>eye</i>
position transformation. The <i>center</i> value indicates the
center of the view that the <i>eye</i> is looking at. The <i>up</i>
value indicates which direction should be considered up with
respect to the <i>eye</i>.</p>


<h3 class="fn"><a name="map" /><a href="qpoint.html">QPoint</a> QMatrix4x4.map (<i>self</i>, <a href="qpoint.html">QPoint</a>&#160;<i>point</i>)</h3><p>Maps <i>point</i> by multiplying this matrix by
<i>point</i>.</p>
<p><b>See also</b> <a href="qmatrix4x4.html#mapRect">mapRect</a>().</p>


<h3 class="fn"><a name="map-2" /><a href="qpointf.html">QPointF</a> QMatrix4x4.map (<i>self</i>, <a href="qpointf.html">QPointF</a>&#160;<i>point</i>)</h3><p>Maps <i>point</i> by multiplying this matrix by
<i>point</i>.</p>
<p><b>See also</b> <a href="qmatrix4x4.html#mapRect">mapRect</a>().</p>


<h3 class="fn"><a name="map-3" /><a href="qvector3d.html">QVector3D</a> QMatrix4x4.map (<i>self</i>, <a href="qvector3d.html">QVector3D</a>&#160;<i>point</i>)</h3><p>Maps <i>point</i> by multiplying this matrix by
<i>point</i>.</p>
<p><b>See also</b> <a href="qmatrix4x4.html#mapRect">mapRect</a>()
and <a href="qmatrix4x4.html#mapVector">mapVector</a>().</p>


<h3 class="fn"><a name="map-4" /><a href="qvector4d.html">QVector4D</a> QMatrix4x4.map (<i>self</i>, <a href="qvector4d.html">QVector4D</a>&#160;<i>point</i>)</h3><p>Maps <i>point</i> by multiplying this matrix by
<i>point</i>.</p>
<p><b>See also</b> <a href="qmatrix4x4.html#mapRect">mapRect</a>().</p>


<h3 class="fn"><a name="mapRect" /><a href="qrect.html">QRect</a> QMatrix4x4.mapRect (<i>self</i>, <a href="qrect.html">QRect</a>&#160;<i>rect</i>)</h3><p>Maps <i>rect</i> by multiplying this matrix by the corners of
<i>rect</i> and then forming a new rectangle from the results. The
returned rectangle will be an ordinary 2D rectangle with sides
parallel to the horizontal and vertical axes.</p>
<p><b>See also</b> <a href="qmatrix4x4.html#map">map</a>().</p>


<h3 class="fn"><a name="mapRect-2" /><a href="qrectf.html">QRectF</a> QMatrix4x4.mapRect (<i>self</i>, <a href="qrectf.html">QRectF</a>&#160;<i>rect</i>)</h3><p>Maps <i>rect</i> by multiplying this matrix by the corners of
<i>rect</i> and then forming a new rectangle from the results. The
returned rectangle will be an ordinary 2D rectangle with sides
parallel to the horizontal and vertical axes.</p>
<p><b>See also</b> <a href="qmatrix4x4.html#map">map</a>().</p>


<h3 class="fn"><a name="mapVector" /><a href="qvector3d.html">QVector3D</a> QMatrix4x4.mapVector (<i>self</i>, <a href="qvector3d.html">QVector3D</a>&#160;<i>vector</i>)</h3><p>Maps <i>vector</i> by multiplying the top 3x3 portion of this
matrix by <i>vector</i>. The translation and projection components
of this matrix are ignored.</p>
<p><b>See also</b> <a href="qmatrix4x4.html#map">map</a>().</p>


<h3 class="fn"><a name="normalMatrix" /><a href="qmatrix3x3.html">QMatrix3x3</a> QMatrix4x4.normalMatrix (<i>self</i>)</h3><p>Returns the normal matrix corresponding to this 4x4
transformation. The normal matrix is the transpose of the inverse
of the top-left 3x3 part of this 4x4 matrix. If the 3x3 sub-matrix
is not invertible, this function returns the identity.</p>
<p><b>See also</b> <a href="qmatrix4x4.html#inverted">inverted</a>().</p>


<h3 class="fn"><a name="optimize" />QMatrix4x4.optimize (<i>self</i>)</h3><p>Optimize the usage of this matrix from its current elements.</p>
<p>Some operations such as <a href="qmatrix4x4.html#translate">translate</a>(), <a href="qmatrix4x4.html#scale">scale</a>(), and <a href="qmatrix4x4.html#rotate">rotate</a>() can be performed more
efficiently if the matrix being modified is already known to be the
identity, a previous <a href="qmatrix4x4.html#translate">translate</a>(), a previous <a href="qmatrix4x4.html#scale">scale</a>(), etc.</p>
<p>Normally the <a href="qmatrix4x4.html">QMatrix4x4</a> class
keeps track of this special type internally as operations are
performed. However, if the matrix is modified directly with
operator()() or <a href="qmatrix4x4.html#data">data</a>(), then
<a href="qmatrix4x4.html">QMatrix4x4</a> will lose track of the
special type and will revert to the safest but least efficient
operations thereafter.</p>
<p>By calling optimize() after directly modifying the matrix, the
programmer can force <a href="qmatrix4x4.html">QMatrix4x4</a> to
recover the special type if the elements appear to conform to one
of the known optimized types.</p>
<p><b>See also</b> <a href="qmatrix4x4.html#operator-28-29">operator</a>()(), <a href="qmatrix4x4.html#data">data</a>(), and <a href="qmatrix4x4.html#translate">translate</a>().</p>


<h3 class="fn"><a name="ortho" />QMatrix4x4.ortho (<i>self</i>, <a href="qrect.html">QRect</a>&#160;<i>rect</i>)</h3><p>Multiplies this matrix by another that applies an orthographic
projection for a window with lower-left corner (<i>left</i>,
<i>bottom</i>), upper-right corner (<i>right</i>, <i>top</i>), and
the specified <i>nearPlane</i> and <i>farPlane</i> clipping
planes.</p>
<p><b>See also</b> <a href="qmatrix4x4.html#frustum">frustum</a>()
and <a href="qmatrix4x4.html#perspective">perspective</a>().</p>


<h3 class="fn"><a name="ortho-2" />QMatrix4x4.ortho (<i>self</i>, <a href="qrectf.html">QRectF</a>&#160;<i>rect</i>)</h3><p>This is an overloaded function.</p>
<p>Multiplies this matrix by another that applies an orthographic
projection for a window with boundaries specified by <i>rect</i>.
The near and far clipping planes will be -1 and 1 respectively.</p>
<p><b>See also</b> <a href="qmatrix4x4.html#frustum">frustum</a>()
and <a href="qmatrix4x4.html#perspective">perspective</a>().</p>


<h3 class="fn"><a name="ortho-3" />QMatrix4x4.ortho (<i>self</i>, float&#160;<i>left</i>, float&#160;<i>right</i>, float&#160;<i>bottom</i>, float&#160;<i>top</i>, float&#160;<i>nearPlane</i>, float&#160;<i>farPlane</i>)</h3><p>This is an overloaded function.</p>
<p>Multiplies this matrix by another that applies an orthographic
projection for a window with boundaries specified by <i>rect</i>.
The near and far clipping planes will be -1 and 1 respectively.</p>
<p><b>See also</b> <a href="qmatrix4x4.html#frustum">frustum</a>()
and <a href="qmatrix4x4.html#perspective">perspective</a>().</p>


<h3 class="fn"><a name="perspective" />QMatrix4x4.perspective (<i>self</i>, float&#160;<i>angle</i>, float&#160;<i>aspect</i>, float&#160;<i>nearPlane</i>, float&#160;<i>farPlane</i>)</h3><p>Multiplies this matrix by another that applies a perspective
projection. The field of view will be <i>angle</i> degrees within a
window with a given <i>aspect</i> ratio. The projection will have
the specified <i>nearPlane</i> and <i>farPlane</i> clipping
planes.</p>
<p><b>See also</b> <a href="qmatrix4x4.html#ortho">ortho</a>() and
<a href="qmatrix4x4.html#frustum">frustum</a>().</p>


<h3 class="fn"><a name="rotate" />QMatrix4x4.rotate (<i>self</i>, float&#160;<i>angle</i>, <a href="qvector3d.html">QVector3D</a>&#160;<i>vector</i>)</h3><p>Multiples this matrix by another that rotates coordinates
through <i>angle</i> degrees about <i>vector</i>.</p>
<p><b>See also</b> <a href="qmatrix4x4.html#scale">scale</a>() and
<a href="qmatrix4x4.html#translate">translate</a>().</p>


<h3 class="fn"><a name="rotate-2" />QMatrix4x4.rotate (<i>self</i>, float&#160;<i>angle</i>, float&#160;<i>x</i>, float&#160;<i>y</i>, float&#160;<i>z</i>&#160;=&#160;0)</h3><p>Multiples this matrix by another that rotates coordinates
according to a specified <i>quaternion</i>. The <i>quaternion</i>
is assumed to have been normalized.</p>
<p><b>See also</b> <a href="qmatrix4x4.html#scale">scale</a>(),
<a href="qmatrix4x4.html#translate">translate</a>(), and <a href="qquaternion.html">QQuaternion</a>.</p>


<h3 class="fn"><a name="rotate-3" />QMatrix4x4.rotate (<i>self</i>, <a href="qquaternion.html">QQuaternion</a>&#160;<i>quaternion</i>)</h3><p>This is an overloaded function.</p>
<p>Multiplies this matrix by another that rotates coordinates
through <i>angle</i> degrees about the vector (<i>x</i>, <i>y</i>,
<i>z</i>).</p>
<p><b>See also</b> <a href="qmatrix4x4.html#scale">scale</a>() and
<a href="qmatrix4x4.html#translate">translate</a>().</p>


<h3 class="fn"><a name="row" /><a href="qvector4d.html">QVector4D</a> QMatrix4x4.row (<i>self</i>, int&#160;<i>index</i>)</h3><p>Returns the elements of row <i>index</i> as a 4D vector.</p>
<p><b>See also</b> <a href="qmatrix4x4.html#setRow">setRow</a>()
and <a href="qmatrix4x4.html#column">column</a>().</p>


<h3 class="fn"><a name="scale" />QMatrix4x4.scale (<i>self</i>, <a href="qvector3d.html">QVector3D</a>&#160;<i>vector</i>)</h3><p>Multiplies this matrix by another that scales coordinates by the
components of <i>vector</i>.</p>
<p><b>See also</b> <a href="qmatrix4x4.html#translate">translate</a>() and <a href="qmatrix4x4.html#rotate">rotate</a>().</p>


<h3 class="fn"><a name="scale-2" />QMatrix4x4.scale (<i>self</i>, float&#160;<i>x</i>, float&#160;<i>y</i>)</h3><p>This is an overloaded function.</p>
<p>Multiplies this matrix by another that scales coordinates by the
components <i>x</i>, and <i>y</i>.</p>
<p><b>See also</b> <a href="qmatrix4x4.html#translate">translate</a>() and <a href="qmatrix4x4.html#rotate">rotate</a>().</p>


<h3 class="fn"><a name="scale-3" />QMatrix4x4.scale (<i>self</i>, float&#160;<i>x</i>, float&#160;<i>y</i>, float&#160;<i>z</i>)</h3><p>This is an overloaded function.</p>
<p>Multiplies this matrix by another that scales coordinates by the
components <i>x</i>, <i>y</i>, and <i>z</i>.</p>
<p><b>See also</b> <a href="qmatrix4x4.html#translate">translate</a>() and <a href="qmatrix4x4.html#rotate">rotate</a>().</p>


<h3 class="fn"><a name="scale-4" />QMatrix4x4.scale (<i>self</i>, float&#160;<i>factor</i>)</h3><p>This is an overloaded function.</p>
<p>Multiplies this matrix by another that scales coordinates by the
given <i>factor</i>.</p>
<p><b>See also</b> <a href="qmatrix4x4.html#translate">translate</a>() and <a href="qmatrix4x4.html#rotate">rotate</a>().</p>


<h3 class="fn"><a name="setColumn" />QMatrix4x4.setColumn (<i>self</i>, int&#160;<i>index</i>, <a href="qvector4d.html">QVector4D</a>&#160;<i>value</i>)</h3><p>Sets the elements of column <i>index</i> to the components of
<i>value</i>.</p>
<p><b>See also</b> <a href="qmatrix4x4.html#column">column</a>()
and <a href="qmatrix4x4.html#setRow">setRow</a>().</p>


<h3 class="fn"><a name="setRow" />QMatrix4x4.setRow (<i>self</i>, int&#160;<i>index</i>, <a href="qvector4d.html">QVector4D</a>&#160;<i>value</i>)</h3><p>Sets the elements of row <i>index</i> to the components of
<i>value</i>.</p>
<p><b>See also</b> <a href="qmatrix4x4.html#row">row</a>() and
<a href="qmatrix4x4.html#setColumn">setColumn</a>().</p>


<h3 class="fn"><a name="setToIdentity" />QMatrix4x4.setToIdentity (<i>self</i>)</h3><p>Sets this matrix to the identity.</p>
<p><b>See also</b> <a href="qmatrix4x4.html#isIdentity">isIdentity</a>().</p>


<h3 class="fn"><a name="toAffine" /><a href="qmatrix.html">QMatrix</a> QMatrix4x4.toAffine (<i>self</i>)</h3><p>Returns the conventional Qt 2D affine transformation matrix that
corresponds to this matrix. It is assumed that this matrix only
contains 2D affine transformation elements.</p>
<p><b>See also</b> <a href="qmatrix4x4.html#toTransform">toTransform</a>().</p>


<h3 class="fn"><a name="toTransform" /><a href="qtransform.html">QTransform</a> QMatrix4x4.toTransform (<i>self</i>)</h3><p>Returns the conventional Qt 2D transformation matrix that
corresponds to this matrix.</p>
<p>The returned <a href="qtransform.html">QTransform</a> is formed
by simply dropping the third row and third column of the <a href="qmatrix4x4.html">QMatrix4x4</a>. This is suitable for implementing
orthographic projections where the z co-ordinate should be dropped
rather than projected.</p>
<p><b>See also</b> <a href="qmatrix4x4.html#toAffine">toAffine</a>().</p>


<h3 class="fn"><a name="toTransform-2" /><a href="qtransform.html">QTransform</a> QMatrix4x4.toTransform (<i>self</i>, float&#160;<i>distanceToPlane</i>)</h3><p>Returns the conventional Qt 2D transformation matrix that
corresponds to this matrix.</p>
<p>If <i>distanceToPlane</i> is non-zero, it indicates a projection
factor to use to adjust for the z co-ordinate. The value of 1024
corresponds to the projection factor used by <a href="qtransform.html#rotate">QTransform.rotate</a>() for the x and y
axes.</p>
<p>If <i>distanceToPlane</i> is zero, then the returned <a href="qtransform.html">QTransform</a> is formed by simply dropping the
third row and third column of the <a href="qmatrix4x4.html">QMatrix4x4</a>. This is suitable for implementing
orthographic projections where the z co-ordinate should be dropped
rather than projected.</p>
<p><b>See also</b> <a href="qmatrix4x4.html#toAffine">toAffine</a>().</p>


<h3 class="fn"><a name="translate" />QMatrix4x4.translate (<i>self</i>, <a href="qvector3d.html">QVector3D</a>&#160;<i>vector</i>)</h3><p>Multiplies this matrix by another that translates coordinates by
the components of <i>vector</i>.</p>
<p><b>See also</b> <a href="qmatrix4x4.html#scale">scale</a>() and
<a href="qmatrix4x4.html#rotate">rotate</a>().</p>


<h3 class="fn"><a name="translate-2" />QMatrix4x4.translate (<i>self</i>, float&#160;<i>x</i>, float&#160;<i>y</i>)</h3><p>This is an overloaded function.</p>
<p>Multiplies this matrix by another that translates coordinates by
the components <i>x</i>, and <i>y</i>.</p>
<p><b>See also</b> <a href="qmatrix4x4.html#scale">scale</a>() and
<a href="qmatrix4x4.html#rotate">rotate</a>().</p>


<h3 class="fn"><a name="translate-3" />QMatrix4x4.translate (<i>self</i>, float&#160;<i>x</i>, float&#160;<i>y</i>, float&#160;<i>z</i>)</h3><p>This is an overloaded function.</p>
<p>Multiplies this matrix by another that translates coordinates by
the components <i>x</i>, <i>y</i>, and <i>z</i>.</p>
<p><b>See also</b> <a href="qmatrix4x4.html#scale">scale</a>() and
<a href="qmatrix4x4.html#rotate">rotate</a>().</p>


<h3 class="fn"><a name="transposed" /><a href="qmatrix4x4.html">QMatrix4x4</a> QMatrix4x4.transposed (<i>self</i>)</h3><p>Returns this matrix, transposed about its diagonal.</p>


<h3 class="fn"><a name="__add__" /><a href="qmatrix4x4.html">QMatrix4x4</a> QMatrix4x4.__add__ (<i>self</i>, <a href="qmatrix4x4.html">QMatrix4x4</a>&#160;<i>m2</i>)</h3><h3 class="fn"><a name="__div__" /><a href="qmatrix4x4.html">QMatrix4x4</a> QMatrix4x4.__div__ (<i>self</i>, float&#160;<i>divisor</i>)</h3><h3 class="fn"><a name="__eq__" />bool QMatrix4x4.__eq__ (<i>self</i>, <a href="qmatrix4x4.html">QMatrix4x4</a>&#160;<i>other</i>)</h3><h3 class="fn"><a name="__getitem__" />object QMatrix4x4.__getitem__ (<i>self</i>, object)</h3><h3 class="fn"><a name="__iadd__" /><a href="qmatrix4x4.html">QMatrix4x4</a> QMatrix4x4.__iadd__ (<i>self</i>, <a href="qmatrix4x4.html">QMatrix4x4</a>&#160;<i>other</i>)</h3><h3 class="fn"><a name="__idiv__" /><a href="qmatrix4x4.html">QMatrix4x4</a> QMatrix4x4.__idiv__ (<i>self</i>, float&#160;<i>divisor</i>)</h3><h3 class="fn"><a name="__imul__" /><a href="qmatrix4x4.html">QMatrix4x4</a> QMatrix4x4.__imul__ (<i>self</i>, <a href="qmatrix4x4.html">QMatrix4x4</a>&#160;<i>other</i>)</h3><h3 class="fn"><a name="__imul__-2" /><a href="qmatrix4x4.html">QMatrix4x4</a> QMatrix4x4.__imul__ (<i>self</i>, float&#160;<i>factor</i>)</h3><h3 class="fn"><a name="__isub__" /><a href="qmatrix4x4.html">QMatrix4x4</a> QMatrix4x4.__isub__ (<i>self</i>, <a href="qmatrix4x4.html">QMatrix4x4</a>&#160;<i>other</i>)</h3><h3 class="fn"><a name="__mul__" /><a href="qmatrix4x4.html">QMatrix4x4</a> QMatrix4x4.__mul__ (<i>self</i>, <a href="qmatrix4x4.html">QMatrix4x4</a>&#160;<i>m2</i>)</h3><h3 class="fn"><a name="__mul__-2" /><a href="qvector3d.html">QVector3D</a> QMatrix4x4.__mul__ (<i>self</i>, <a href="qvector3d.html">QVector3D</a>&#160;<i>vector</i>)</h3><h3 class="fn"><a name="__mul__-3" /><a href="qvector4d.html">QVector4D</a> QMatrix4x4.__mul__ (<i>self</i>, <a href="qvector4d.html">QVector4D</a>&#160;<i>vector</i>)</h3><h3 class="fn"><a name="__mul__-4" /><a href="qpoint.html">QPoint</a> QMatrix4x4.__mul__ (<i>self</i>, <a href="qpoint.html">QPoint</a>&#160;<i>point</i>)</h3><h3 class="fn"><a name="__mul__-5" /><a href="qpointf.html">QPointF</a> QMatrix4x4.__mul__ (<i>self</i>, <a href="qpointf.html">QPointF</a>&#160;<i>point</i>)</h3><h3 class="fn"><a name="__mul__-6" /><a href="qmatrix4x4.html">QMatrix4x4</a> QMatrix4x4.__mul__ (<i>self</i>, <a href="qmatrix4x4.html">QMatrix4x4</a>&#160;<i>matrix</i>)</h3><h3 class="fn"><a name="__mul__-7" /><a href="qmatrix4x4.html">QMatrix4x4</a> QMatrix4x4.__mul__ (<i>self</i>, float&#160;<i>factor</i>)</h3><h3 class="fn"><a name="__ne__" />bool QMatrix4x4.__ne__ (<i>self</i>, <a href="qmatrix4x4.html">QMatrix4x4</a>&#160;<i>other</i>)</h3><h3 class="fn"><a name="__neg__" /><a href="qmatrix4x4.html">QMatrix4x4</a> QMatrix4x4.__neg__ (<i>self</i>)</h3><h3 class="fn"><a name="__repr__" />str QMatrix4x4.__repr__ (<i>self</i>)</h3><h3 class="fn"><a name="__setitem__" />QMatrix4x4.__setitem__ (<i>self</i>, object, float)</h3><h3 class="fn"><a name="__sub__" /><a href="qmatrix4x4.html">QMatrix4x4</a> QMatrix4x4.__sub__ (<i>self</i>, <a href="qmatrix4x4.html">QMatrix4x4</a>&#160;<i>m2</i>)</h3><address><hr /><div align="center"><table border="0" cellspacing="0" width="100%"><tr class="address"><td align="left" width="25%">PyQt&#160;4.9.1 for X11</td><td align="center" width="50%">Copyright &#169; <a href="http://www.riverbankcomputing.com">Riverbank&#160;Computing&#160;Ltd</a> and <a href="http://www.qtsoftware.com">Nokia</a> 2011</td><td align="right" width="25%">Qt&#160;4.8.0</td></tr></table></div></address></body></html>